# while 遍历list
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
print("while遍历list")
index = 0
while index < len(list1):
    print(list1[index], end=" ")
    index += 1
# for 遍历list
print("\nfor遍历list")
for i in list1:
    print(i)
